package br.com.pizzaria.util;

import java.io.IOException;

import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;

public class Util {

	public static void redirect(String page) {
		try {
			FacesContext.getCurrentInstance().getExternalContext()
					.redirect(page);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public static void facesMessageSeverityErro(String message) {
		FacesContext.getCurrentInstance().addMessage(null,
				new FacesMessage(FacesMessage.SEVERITY_ERROR, message, ""));
	}

}
